import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/Login'
import Home from '@/views/layout/Home'

// oms
import OmsOrderIndex from '@/views/oms/order/index'
import OmsOrderDetail from '@/views/oms/order/orderDetail'
import OmsOrderDeliverOrder from '@/views/oms/order/deliverOrderList'
import OmsOrderSetting from '@/views/oms/order/setting'

import OmsOrderApplyIndex from '@/views/oms/apply/index'
import OmsOrderApplyDetail from '@/views/oms/apply/applyDetail'
import OmsOrderApplyReason from '@/views/oms/apply/reason'

// pms组件
import PmsBrandIndex from '@/views/pms/brand/index'
import PmsBrandAdd from '@/views/pms/brand/add'
import PmsBrandUpdate from '@/views/pms/brand/update'

import PmsProductAttrIndex from '@/views/pms/productAttr/index'

import PmsProductAttributeManager from '@/views/pms/productAttr/PmsProductAttributeManager'
import PmsProductCategoryManager from '@/views/pms/productCate/PmsProductCategoryManager'
import PmsProductIndex from '@/views/pms/product/Index'
import PmsProductAdd from '@/views/pms/product/Add'
import PmsProductUpdate from '@/views/pms/product/Update'

// ums
import UmsMenuIndex from '@/views/ums/menu/index'
import UmsMenuAdd from '@/views/ums/menu/add'
import UmsMenuUpdate from '@/views/ums/menu/update'

import UmsResourceIndex from '@/views/ums/resource/index'
import UmsResourceCategoryIndex from '@/views/ums/resource/categoryList'

import UmsRoleIndex from '@/views/ums/role/index'
import UmsAllocMenu from '@/views/ums/role/allocMenu'
import UmsAllocResource from '@/views/ums/role/allocResource'

import UmsAdminIndex from '@/views/ums/admin/index'

// 总布局
import Layout from '@/components/layout/Layout'

// test
import Test from '@/views/test/Test'

Vue.use(Router)

export const  asyncRouterMap=[

]

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login
    },

    {
      path: '/login',
      name: 'toLogin',
      component: Login
    },
    {
      path: '/home',
      name: 'home',
      component: Home,
      children: [
        // 订单管理
        {
          path: '/omsOrderIndex',
          name: 'OmsOrderIndex',
          component: OmsOrderIndex
        },
        {
          path: '/omsOrderDetail',
          name: 'OmsOrderDetail',
          component: OmsOrderDetail
        },
        {
          path: '/omsOrderDeliverOrder',
          name: 'OmsOrderDeliverOrder',
          component: OmsOrderDeliverOrder
        },
        // 订单设置
        {
          path: '/omsOrderSetting',
          name: 'OmsOrderSetting',
          component: OmsOrderSetting
        },
        // 退货管理
        {
          path: '/omsOrderApplyIndex',
          name: 'OmsOrderApplyIndex',
          component: OmsOrderApplyIndex,
        },
        {
          path: '/omsOrderApplyDetail',
          name: 'OmsOrderApplyDetail',
          component: OmsOrderApplyDetail
        },
        {
          path: '/omsOrderApplyReason',
          name: 'OmsOrderApplyReason',
          component: OmsOrderApplyReason,
        },
        // 品牌管理
        {
          path: '/brandList',
          name: 'PmsBrandIndex',
          component: PmsBrandIndex
        },
        {
          path: '/branAdd',
          name: 'PmsBrandAdd',
          component: PmsBrandAdd
        },
        {
          path: '/brandUpdate',
          name: 'PmsBrandUpdate',
          component: PmsBrandUpdate
        },
        // 属性分类管理
        {
          path: '/pmsProductAttributeList',
          name: 'PmsProductAttrIndex',
          component: PmsProductAttrIndex
        },
        // 属性管理
        {
          path: '/pmsProductAttributeManager',
          name: 'PmsProductAttributeManager',
          component: PmsProductAttributeManager
        },
        // 商品分类管理
        {
          path: '/pmsProductCategoryManager',
          name: 'PmsProductCategoryManager',
          component: PmsProductCategoryManager
        },
        // 商品
        {
          path: '/pmsProductIndex',
          name: 'PmsProductIndex',
          component: PmsProductIndex
        },
        {
          path: '/pmsProductAdd',
          name: 'PmsProductAdd',
          component: PmsProductAdd
        },
        {
          path: '/pmsProductUpdate',
          name: 'PmsProductUpdate',
          component: PmsProductUpdate
        },

        // 菜单
        {
          path: '/umsMenuAdd',
          name: 'UmsMenuAdd',
          component: UmsMenuAdd
        },
        {
          path: '/umsMenuIndex',
          name: 'UmsMenuIndex',
          component: UmsMenuIndex
        },
        {
          path: '/umsMenuUpdate',
          name: 'UmsMenuUpdate',
          component: UmsMenuUpdate
        },
        // 资源
        {
          path: '/umsResourceIndex',
          name: 'UmsResourceIndex',
          component: UmsResourceIndex
        },
        {
          path: '/umsResourceCategoryIndex',
          name: 'UmsResourceCategoryIndex',
          component: UmsResourceCategoryIndex
        },
        // 角色-新
        {
          path: '/umsRoleIndex',
          name: 'UmsRoleIndex',
          component: UmsRoleIndex
        },
        // 角色分配菜单
        {
          path: '/umsAllocMenu',
          name: 'UmsAllocMenu',
          component: UmsAllocMenu
        },
        // 角色资源分配
        {
          path: '/umsAllocResource',
          name: 'UmsAllocResource',
          component: UmsAllocResource
        },
        // 用户管理
        {
          path: '/umsAdminIndex',
          name: 'UmsAdminIndex',
          component: UmsAdminIndex
        }
      ]
    },

    // 测试页面
    {
      path: '/layout',
      component: Layout,
      name: '/layout',
      meta: {title: '订单'},
      children: [
        {
          path: '/test',
          name: 'Test',
          component: Test,
          meta: {title: '测试页面', icon: 'product'},
        },
      ]
    },
    
    // {
    //   path: '/layout',
    //   name: 'Layout', 
    //   component: Layout,
    //   meta: {title: '首页布局'}
    // },
  ]
})
